import matplotlib.pyplot as plt
import numpy as np
from mpl_toolkits.mplot3d import Axes3D

Class1 = np.array([-3, -2, -1, 0])
Class2 = np.array([1, 2, 3, 4])

def modell(w0, w1, x):
    return w0 + w1*x

def testMafunc(W0, W1):
    wucha = np.zeros((W0.shape), dtype=float)
    for one in Class1:
        rwucha = modell(W0, W1, one)
        # rwucha[rwucha<0] = 0
        wucha = wucha + rwucha
    for one in Class2:
        rwucha = modell(W0, W1, one)
        # rwucha[rwucha>0] = 0
        wucha = wucha - rwucha
    return wucha


fig = plt.figure()
ax = Axes3D(fig)
X = np.arange(-80, 80, 2) # w0
Y = np.arange(-10, 10.2, 0.2) # w1
X, Y = np.meshgrid(X, Y)
S = testMafunc(X, Y)
ax.plot_surface(X, Y, S, rstride=1, cstride=1, cmap='hot')
plt.show()